package com.coder.shop.dao.model;

import java.io.Serializable;
import java.math.BigDecimal;

public class ShopPromotion implements Serializable {
    /**
     * id
     *
     * @mbg.generated
     */
    private Long id;

    /**
     * 分类(1：满减，2：满赠)
     *
     * @mbg.generated
     */
    private Boolean type;

    /**
     * 满
     *
     * @mbg.generated
     */
    private BigDecimal reach;

    /**
     * 减
     *
     * @mbg.generated
     */
    private BigDecimal off;

    private static final long serialVersionUID = 1L;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Boolean getType() {
        return type;
    }

    public void setType(Boolean type) {
        this.type = type;
    }

    public BigDecimal getReach() {
        return reach;
    }

    public void setReach(BigDecimal reach) {
        this.reach = reach;
    }

    public BigDecimal getOff() {
        return off;
    }

    public void setOff(BigDecimal off) {
        this.off = off;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", type=").append(type);
        sb.append(", reach=").append(reach);
        sb.append(", off=").append(off);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ShopPromotion other = (ShopPromotion) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getReach() == null ? other.getReach() == null : this.getReach().equals(other.getReach()))
            && (this.getOff() == null ? other.getOff() == null : this.getOff().equals(other.getOff()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getReach() == null) ? 0 : getReach().hashCode());
        result = prime * result + ((getOff() == null) ? 0 : getOff().hashCode());
        return result;
    }
}